﻿@model ICollection<MoviesRoom.ViewModels.Comment.CommentViewModel>

<h3>Recent Comments:</h3>
<div id="comments-wrapper">
    <div class="film-comments">
        @foreach (var comment in Model)
        {
                    <div>
                        <div class="comment">
                            @comment.Text
                        </div>
                        <p class="italic">commented by: </p>

                        <div class="user@(comment.IsAdmin ? " admin" : "")">@comment.Author</div>


                        @if (User.IsInRole("admin") || User.Identity.Name == comment.Author)
                        {
                                                    @Html.ActionLink("Edit", "Edit", "Comment", new { id = comment.Id }, new { @class = "btn-small" })
                                                    @Html.ActionLink("Delete", "Delete", "Comment", new { id = comment.Id }, new { @class = "btn-small" })
                        }
                    </div>
        }
    </div>
</div>
